package com.sayyi.demo.micro.order.service.impl;

import com.sayyi.demo.micro.order.service.StorageSagaService;
import com.sayyi.demo.micro.storage.api.StorageApi;
import com.sayyi.demo.micro.storage.domain.UpdateStorageRequest;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

@Service("storageSagaService")
public class StorageSagaServiceImpl implements StorageSagaService {

    @DubboReference(version = "1.0.0")
    private StorageApi storageApi;


    @Override
    public boolean updateStorage(UpdateStorageRequest updateStorageRequest) {
        return storageApi.updateStorage(updateStorageRequest);
    }

    @Override
    public boolean compensateStorage(UpdateStorageRequest updateStorageRequest) {
        return storageApi.compensateStorage(updateStorageRequest);
    }
}
